Fixed what-if functionality with -QueryString parameter#14328
Fixed what-if functionality with -QueryString parameter#14328isra-fel merged 18 commits intoAzure:release-2021-03-23from
Conversation
|
|
||
| if (!string.IsNullOrEmpty(this.QueryString)) | ||
| { | ||
| properties.TemplateLink.QueryString = this.QueryString; |
There was a problem hiding this comment.
Can you add a test for this?
There was a problem hiding this comment.
Pushed a test case
shenglol
left a comment
There was a problem hiding this comment.
Looks good to me but still need reviews from the PS team.
There are some credscan failures that I am trying to fix |
The credscan issues are false positives as the credentials are invalid and are for non existent resources. |
|
The credscan issues have been suppressed. |
| { | ||
| helper.RMResourceModule, | ||
| helper.GetRMModulePath("AzureRM.Monitor.psd1") | ||
| helper.GetRMModulePath("AzureRM.Monitor.psd1"), |
There was a problem hiding this comment.
Add helper.GetRMModulePath("AzureRM.Storage.psd1"), here to use cmdlets in Storage when running test cases.
There was a problem hiding this comment.
@wyunchi-ms I made the suggested changes, but now it fails with "Device not configured"
| $token = New-AzStorageAccountSASToken -Service File -ResourceType Service,Container,Object -Permission "r" -Context $context -ExpiryTime (Get-Date).AddMinutes(3) | ||
|
|
||
| #Create deployment | ||
| $deployment =New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringpstests.file.core.windows.net/querystringshare/sampleLinkedTemplateParent.json" -QueryString $token.Substring(1) |
There was a problem hiding this comment.
Is this URL valid? I cannot access it in my environment.
There was a problem hiding this comment.
Same reasoning as the comment below
| Assert-AreEqual Succeeded $deployment.ProvisioningState | ||
|
|
||
| #Run What-if | ||
| $result = New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringpstests.file.core.windows.net/querystringshare/sampleLinkedTemplateParent.json" -QueryString $token.Substring(1) -WhatIf |
There was a problem hiding this comment.
Is this URL valid? I cannot access it in my environment.
There was a problem hiding this comment.
Same reasoning as the comment below
|
|
||
| #Create deployment | ||
| $deployment =New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringtesting.blob.core.windows.net/testqsblob/linkedTemplateParent.json" -QueryString "foo" | ||
| $deployment =New-AzResourceGroupDeployment -Name $rname -ResourceGroupName $rgname -TemplateUri "https://querystringpstests.file.core.windows.net/querystringshare/sampleLinkedTemplateParent.json" -QueryString $token.Substring(1) |
There was a problem hiding this comment.
Is this URL valid? I cannot access it in my environment.
There was a problem hiding this comment.
They are urls for a storage account created during the test and deleted after it is completed. So you will not be able to access it outside of the test. But at the time of the test execution (recording), the urls are valid.
There was a problem hiding this comment.
@wyunchi-ms any idea on what is happening with this error?
|
The checks should be passing now. @wyunchi-ms |
…to xynoclafe/whatIfQueryString
|
The checks are either not starting or just getting stuck in running (even though the actual pipelines for them seem to have run successfully). Is there something wrong with the checks/pipeline? |
* update readme * Update README.md
|
The earlier check failures were due to some merge issues with the credScanSuppression file. The checks are passing now, we should be able to merge this. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added